<?php
function json_message($code, $message = null, $data = null, $ext_data = null) {
	$tmp_json = array ('code' => $code, 'msg' => $message, 'data' => $data );
	if ($ext_data && is_array ( $ext_data )) {
		foreach ( $ext_data as $key => $value ) {
			$tmp_json [$key] = $value;
		}
	}
	echo json_encode ( $tmp_json );
}